package com.yhtech.utils;

import java.util.Calendar;
import java.util.Date;

public class DateTimeUtils {
	/**
	 * 比较两个日期的大小
	 * @return
	 */
	public static long dateDiff(final Date beginDate,final Date endDate ){
		 if(beginDate != null && endDate != null){
			 return endDate.getTime()-beginDate.getTime();
		 }else{
			 throw new RuntimeException("参数传递有误!");
		 }
		
	}
	
	public static void main(String[] args) {
		Date b1 = new Date();
		Date b2 = new Date();
        
		System.out.println(dateDiff(new Date(), new Date()));
	}

}
